# -*- coding: utf-8 -*-
# @Time:2021/04/18 15:28
# @Author:Cindy
from time import sleep

from selenium.webdriver.common.by import By

from pages.add_member_page import AddMember
from pages.base_page import BasePage
from pages.contact_page import Contact


class MainPage(BasePage):

    def goto_addmember(self):
        """
        跳转到添加成员页面，返回实例对象
        :return:
        """
        self.driver.find_element(By.CSS_SELECTOR, ".index_service a:nth-child(1)").click()
        return AddMember(self.driver)

    def goto_contact(self):
        """
        跳转到通讯录页面
        :return:
        """
        self.driver.find_element(By.CSS_SELECTOR, ".frame_nav>a:nth-child(2)").click()
        sleep(5)
        return Contact(self.driver)
